createOnnxRandomAccessSourceFromBlob

suspend fun createOnnxRandomAccessSourceFromBlob(blob: Blob, preloadSize: Int = JsBlobRandomAccessSource.DEFAULT_PRELOAD_SIZE): JsBlobRandomAccessSource(source)

Create a RandomAccessSource from a browser Blob or File.

This is the browser-specific way to create streaming ONNX readers. Use with file input elements or File System Access API.

Example:

// With file input
val file = document.getElementById("fileInput").files[0]
val source = createOnnxRandomAccessSourceFromBlob(file)
val reader = StreamingOnnxReader.open(source)

Return

JsBlobRandomAccessSource for streaming access

Parameters

blob

The Blob or File to read from

preloadSize

How much to preload for sync metadata access (default 50MB)